home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Mathematics / Notebooks / SigProc2.0 / Packages / SignalProcessing / ObjectOriented.m < prev    next >
Encoding:
Text File  |  1992-08-18  |  4.5 KB  |  155 lines

  1. (*  :Title:    Initialization for Object-Oriented Signal Processing Package  *)
  2.  
  3. (*  :Authors:    Brian Evans, James McClellan  *)
  4.  
  5. (*  :Summary:    This is an initialization file only  *)
  6.  
  7. (*  :Context:    Global`  *)
  8.  
  9. (*  :PackageVersion:  2.74    *)
  10.  
  11. (*
  12.     :Copyright:    Copyright 1989-1992 by Brian L. Evans
  13.         Georgia Tech Research Corporation
  14.  
  15.     Permission to use, copy, modify, and distribute this software
  16.     and its documentation for any purpose and without fee is
  17.     hereby granted, provided that the above copyright notice
  18.     appear in all copies and that both that copyright notice and
  19.     this permission notice appear in supporting documentation,
  20.     and that the name of Georgia Tech or Georgia Institute of
  21.     Technology not be used in advertising or publicity pertaining
  22.     to distribution of the software without specific, written prior
  23.     permission.  Georgia Tech makes no representations about the
  24.     suitability of this software for any purpose.  It is provided
  25.     "as is" without express or implied warranty.
  26.  *)
  27.  
  28. (*  :History:    *)
  29.  
  30. (*  :Keywords:    *)
  31.  
  32. (*  :Source:    *)
  33.  
  34. (*  :Warning:    *)
  35.  
  36. (*  :Mathematica Version:  1.2 or 2.0  *)
  37.  
  38. (*  :Limitation:  *)
  39.  
  40.  
  41. (*  B E G I N     I N I T I A L I Z A T I O N  *)
  42.  
  43.  
  44. (*  Load those routines on which these packages rely  *) 
  45.  
  46. Needs[ "SignalProcessing`Support`" ]
  47.  
  48.  
  49. Which [
  50.  
  51.  
  52. (*  Check to make sure that these packages has not already been loaded  *)
  53.  
  54. MemberQ[ $ContextPath, "SignalProcessing`ObjectOriented`" ],
  55.  
  56.   object::loaded =
  57.     "Version 2.74 of the property and rewrite rules for \
  58.         signals and systems has already been loaded.",
  59.  
  60.  
  61. (*  For Mathematica 2.0, we only define the stubs  *)
  62.  
  63. TrueQ[ $VersionNumber >= 2.0 ],
  64.  
  65.   Print["Defining stubs for version 2.74 of the \
  66.            property and rewrite rules for signals and systems." ];
  67.  
  68.   DeclarePackage[ "SignalProcessing`ObjectOriented`Heuristics`", { 
  69.             "SPHeuristicRewrite", "SPRecursiveRewrite" } ];
  70.  
  71.   DeclarePackage[ "SignalProcessing`ObjectOriented`RewriteRules`", { 
  72.             "SystemRewriteRules" } ];
  73.  
  74.   DeclarePackage[ "SignalProcessing`ObjectOriented`Signal`", { 
  75.             "ArraySignal", "ArraySignalQ", "CenterOfSymmetry",
  76.             "ComputableSignalQ", "DiscreteTimeSignalQ",
  77.             "EndBandwith", "Fetch", "FetchArray", "FetchNext",
  78.             "IIRCoefficients", "IndependentVariable",
  79.             "IIRFilter", "IIRPostUpdate", "MakeContinuousSignal",
  80.             "MakeDigitalSignal", "MakeSignal", "MyMakeSignal",
  81.             "NextFun", "OutOfDomainValue", "PastValues",
  82.             "PointwiseSignal", "PointwiseSignalQ",
  83.             "PostUpdateFunction", "PreUpdateFunction", "PrintName",
  84.             "RealOrComplex", "Self", "Signal", "SignalQ",
  85.             "StartBandwith", "StreamSignal", "StreamSignalQ" } ];
  86.  
  87.   DeclarePackage[ "SignalProcessing`ObjectOriented`Slot`", { 
  88.             "AddSlot", "AppendSlot", "DefaultSlot",
  89.             "DefineObjectType", "DeleteSlot", "HasSlotQ",
  90.             "MakeObject", "ReadOnlyList", "ReadOnlySlotQ",
  91.             "ReadSlot", "WriteSlot" } ];
  92.  
  93.   DeclarePackage[ "SignalProcessing`ObjectOriented`StackQueue`", { 
  94.             "ClearQueue", "ClearStack", "Dequeue", "Enqueue",
  95.             "Pop", "Push", "Queue", "TopElement" } ];
  96.  
  97.   DeclarePackage[ "SignalProcessing`ObjectOriented`System`", { 
  98.             "ASSOCIATIVE", "ADDITIVE", "COMMUTATIVE", "CONTINUOUS",
  99.             "DefineSystem", "DISCRETE", "HOMOGENEOUS", "LINEAR",
  100.             "LINEARPHASE", "MEMORYLESS", "MoveOperatorsToFront",
  101.             "SEPARABLE", "SHIFTINVARIANT", "SystemProperties",
  102.             "SPsystems", "SPproperties", "SystemQ",
  103.             "ValidOperatorQ" } ];
  104.  
  105.   AppendTo[$ContextPath, "SignalProcessing`ObjectOriented`"];
  106.  
  107.   object::loaded =
  108.     "Stubs for the routines, objects, and rules for the object signal \
  109.     processing package have been loaded successfully.",
  110.  
  111.  
  112. (*  Object-oriented signal processing --  load in hierarchial order. *)
  113.  
  114. True,
  115.  
  116.   Print[ "Loading version 2.74 of property and rewrite rules for \
  117.             signals and systems." ];
  118.  
  119.   Needs[ "SignalProcessing`ObjectOriented`StackQueue`" ];    (* level a *)
  120.   Needs[ "SignalProcessing`ObjectOriented`Slot`" ];
  121.  
  122.   Needs[ "SignalProcessing`ObjectOriented`System`" ];        (* level b *)
  123.   Needs[ "SignalProcessing`ObjectOriented`RewriteRules`" ];
  124.  
  125.   Needs[ "SignalProcessing`ObjectOriented`Signal`" ];        (* level c *)
  126.  
  127.   AppendTo[$ContextPath, "SignalProcessing`ObjectOriented`"];
  128.  
  129.   object::loaded =
  130.     "Routines, objects, and rules for the object signal \
  131.     processing package have been loaded successfully."
  132.  
  133. ]
  134.  
  135.  
  136. (*  Temporary messages  *)
  137.  
  138. object::error = "The current context should be Global` and it is not."
  139.  
  140. (*  Error checking  *)
  141.  
  142. If [ SameQ[$Context, "Global`"],
  143.      Message[ object::loaded ],
  144.      Message[ object::error ] ]
  145.  
  146. (*  Remove temporary messages  *)
  147.  
  148. object::error = .
  149. object::loaded = .
  150.  
  151.  
  152. (*  E N D     I N I T I A L I Z A T I O N  *)
  153.  
  154. Null
  155.